package homework;
/*
对象序列化   输出（从程序到文件）
 */
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "kk";
        String gender = "男";
        int age = 30;
        String[] otherInfo  = {"da","468","4fs"};
        Student kk = new Student(name,gender,age,otherInfo);
        FileOutputStream fos = new FileOutputStream("I'M K.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(kk);
        System.out.println("写出完毕");
        oos.close();
    }
}
